package com.qc

class Reports {
    static belongsTo = [
            file: Files,
            analysis: Builds
        ]
    int loc
    int comments
    int complexity
    float avgComplexity
    float lcom
    float avgLcom
    float coverage
    int eloc
    float favg

    static constraints = {
        loc(nullable: true)
        comments(nullable: true)
        complexity(nullable:true)
        avgComplexity(nullable: true)
        lcom(nullable: true)
        avgLcom(nullable: true)
        coverage(nullable:true)
        eloc(nullable: true)
    }

    Float commentsPercent() {
          comments / (comments + loc)
    }
}
